#include "animation.h"

Animation::Animation(std::vector<Texture *> aTextures, int nStep) : textures(aTextures), stepLength(nStep)
{
    currentStep=0;
    stepCount=0;

}

void Animation::Use()
{
    textures.at(currentStep)->Use();

    stepCount++;

    if(stepCount>stepLength)
    {
        currentStep++;
        stepCount=0;
        if(currentStep>textures.size()-1)
        {
            currentStep=0;
        }
    }
}
